# Makefile for libtoaster entire directory
#  
#   very top libtoaster directory

# BUILD VARIABLES
#
# DEVELOPER=1 : USED FOR debian yuma-dev package

##################### LIBRARIES ########################
#
# DIRS:  
# This is an ordered list
# Put only the directories that build object files in the list

# make all targets
DIRS = src


ifndef PREFIX
    PREFIX=/usr
endif

SRC_INST=$(DESTDIR)$(PREFIX)/share/yuma/src/libtoaster


#################### PLATFORM DEFINITIONS ############
all: toasterall


################################ MAKE RULES #################################
#

clean: toasterclean

superclean: toastersuperclean

distclean: toastersuperclean

ifdef DEBIAN
ifdef DEVELOPER
install: toasterinstall
else
install: libinstall
endif  # DEVELOPER
else
install: toasterinstall libinstall
endif  # DEBIAN

toasterall:
	mkdir -p lib bin
	for dir in $(DIRS); do\
	  cd $$dir && $(MAKE) && cd ..;\
        done

toasterclean:
	for dir in $(DIRS); do\
	  cd $$dir && $(MAKE) clean && cd ..;\
        done

toastersuperclean:
	for dir in $(DIRS); do\
	  cd $$dir && $(MAKE) superclean && cd ..;\
        done

libinstall:
	for dir in $(DIRS); do\
          cd $$dir && $(MAKE) install && cd ..;\
        done

toasterinstall:
	mkdir -p $(SRC_INST)
	mkdir -p $(SRC_INST)/src
	mkdir -p $(SRC_INST)/lib
	mkdir -p $(SRC_INST)/bin
	cp Makefile $(SRC_INST)
	cp src/*start $(SRC_INST)/src/
	cp src/*c $(SRC_INST)/src/
	cp src/*h $(SRC_INST)/src/
	cp src/Makefile $(SRC_INST)/src/


.PHONY: all clean superclean install libinstall \
	toasterall toasterclean toastersuperclean toasterinstall distclean


# prevent the make program from choking on all the symbols
# that get generated from autogenerated make rules
.NOEXPORT:



